package com.gxa.ssm251.proxy.jdkproxy;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

@Component
public class UserMapperInvocationHandler implements InvocationHandler {
    @Resource
    UserDao userMapper1;
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("前置增强");
        Object invoke = method.invoke(userMapper1, args);
        System.out.println("后置增强");
        return invoke;
    }
}
